BlePeriph.DefineService

This command registers a new BLE service. When a BLE Central tries to discover services, this service will be amongst the available ones.

This method has to be called when BLE is disabled, i.e. before calling BlePeriph.Enable(true).

Properties

Parameters (request frame)

Name Type/Size Description
Length of ServiceUUID Integer (8 bits) Length of ServiceUUID in bytes
ServiceUUID Raw data Specifies the UUID (16 or 128 bits) of the BLE service
Length of Characteristics Integer (8 bits) Number of elements in the Characteristics array
Characteristics Array List of characteristics
Length of CharacteristicUUID Integer (8 bits) Length of CharacteristicUUID in bytes
CharacteristicUUID Raw data Specifies the UUID (16 ir 128 bits) of the BLE characteristic
Size Integer (16 bits) Specifies the size of the characteristic in bytes. If VariableSize is set, this is not the exact size, but the maximum size of the attribute. The maximum size of a characteristic is 512 bytes.
- Bit mask (8 bits) -
SupportsRead Boolean (bit 0x80) -
SupportsWrite Boolean (bit 0x40) -
SupportsNotify Boolean (bit 0x20) -
SupportsIndicate Boolean (bit 0x10) -
VariableSize Boolean (bit 0x08) -
RFU Integer (bit mask area 0x07) Zero padding

Returned values (response frame)

None